<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
                <!--<div class="w-lg">-->
                <form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.valuationType">
                                <option value="">--全部--</option>
                                <option value="1">cpc</option>
                                <option value="2">cps</option>
                                <option value="2">cpa</option>
                                <option value="4">cpm</option>
                            </select>
                        </div>



                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="searchParams.planName"
                                   placeholder="投放计划名称">
                        </div>

                        <div class="col-sm-2">
                                <input type="text" ng-model="searchParams.putStartTime" placeholder="投放开始日期" class="form-control" id="putStartTime" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-2">
                                <input type="text" ng-model="searchParams.putEndTime" placeholder="投放结束日期" class="form-control" id="putEndTime" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.status">
                                <option value="">--全部状态--</option>
                                <option value="2">待审核</option>
                                <option value="3">审核通过</option>
                                <option value="4">审核失败</option>
                                <option value="5">取消</option>
                                <option value="6">暂停</option>
                            </select>
                        </div>



                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="searchParams.industry"
                                   placeholder="行业关键字">
                            <!--<span class="input-group-btn">-->
                            <!--<button class="btn btn-default" type="submit" style="height: 38px;"><i class="fa fa-search"></i></button>-->
                        </div>
                    </div>
                    <div class="form-group">

                        <div class="col-sm-2">
                                <input type="text" ng-model="searchParams.createStartTime" placeholder="申请开始时间"  class="form-control" id="createStartTime" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-sm-2">
                            <input type="text" ng-model="searchParams.createEndTime" placeholder="申请结束时间"  class="form-control" id="createEndTime" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-sm-2">
                                <input type="text" ng-model="searchParams.examineStartTime" placeholder="审核开始时间" class="form-control" id="examineStartTime" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" ng-model="searchParams.examineEndTime" placeholder="审核结束时间" class="form-control" id="examineEndTime" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.Adstatus">
                                <option value="">--广告审核状态--</option>
                                <option value="0">待审核</option>
                                <option value="1">审核通过</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-primary" ng-click="searchRe()" type="submit">查 询</button></label>
                        </div>
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-dark" ng-click="clearSearch()" type="reset">清 空</button></label>
                        </div>
                    </div>
                </form>
                <!--</div>-->
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th><input type="checkbox" ng-click="selectAll($event)"/>全选</th>
                        <th>计划ID</th>
                        <th>广告主名称</th>
                        <th>计划名称</th>
                        <th>类型</th>
                        <!--<th>行业</th>-->
                        <!--<th>投放平台</th>-->
                        <!--<th>价格</th>-->
                        <th>申请时间</th>
                        <th>审核时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.records">
                        <td class="v-middle">
                            <input type="checkbox" name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item)"/>
                        </td>
                        <td class="v-middle">{{item.id}}</td>
                        <td class="v-middle">{{item.advertName}}</td>
                        <td class="v-middle">{{item.planName}}</td>
                        <td class="v-middle">{{item.valuationType}}</td>
                        <!--<td class="v-middle">-->
                            <!--<span title="{{item.adTradeContent}}">{{item.adTradeContent | limitTo:10}}</span>-->
                        <!--</td>-->


                        <!--<td class="v-middle">-->
                            <!--<span ng-repeat="adi in item.adDetail" >-->
                                <!--<span ng-if="$index<2">-->
                                    <!--{{adi.platform_name}}</br>-->
                                <!--</span>-->
                            <!--</span>-->
                        <!--</td>-->
                        <!--<td class="v-middle">-->
                            <!--<span ng-repeat="adi in item.adDetail">-->
                                 <!--<span ng-if="$index<2">-->
                                    <!--{{adi.click_price}}</br>-->
                                <!--</span>-->
                            <!--</span>-->
                        <!--</td>-->
                        <td class="v-middle">{{item.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
                        <td class="v-middle">{{item.approveTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
                        <td class="v-middle">
                            <span ng-if="item.status=='2'" class="text-danger">待审核</span>
                            <span ng-if="item.status=='3'" class="text-success">审核通过</span>
                            <span ng-if="item.status=='4'">审核失败</span>
                            <span ng-if="item.status=='5'">取消</span>
                            <span ng-if="item.status=='6'">暂停</span>
                            <span ng-if="item.status=='8'">已提交</span>
                        </td>
                        <td class="v-middle">
                            <a ui-sref="main.zzy.zzyLaunchPlan.planDetail({adPlanId: item.id})" class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>详情</a>

                            <!-- <button type="button" ng-click="detail(item.id, 1)" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-info m-r-xs text-sm"></i>详情</button> -->
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->
    <form id="savePlan">
        <div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="refuseUserSupply" role="dialog" aria-labelledby="gridSystemModalLabelSupply">
            <div class="modal-dialog modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="gridSystemModalLabelSupply" ><span id="title"></span>审核</h4>
                    </div>
                    <div class="modal-body">
                        <p></p>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right">拒绝原因:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="approveReason" maxlength="60" placeholder="请输入拒绝原因" ng-model="param.approveReason">
                            </div>
                        </div>
                        <p></p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" ng-click="saveApproveReason()">确定</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </form>
</div><!-- /.wrapper-md -->